package com.algo.Jaya;

import org.springframework.core.annotation.Order;

/**
 * @Author: guoxing
 * @Email: gx_study2022@163.com
 * @Description: https://blog.csdn.net/qq_37853160/article/details/127273019
 * @Date: 2024/6/24 22:28
 * @ClassName: RawData
 **/
public class RawData {
    private int[][][][] data;
    private int jobNum;
    private int totalProcessNum;
    private int machineNum;

    public static final int[][][][] INSTANCE8= new int[][][][]{
            {{{1,5},{2,3},{3,5},{4,3},{5,3},{7,10},{8,9}},{{1,10},{3,5},{4,8},{5,3},{6,9},{7,9},{8,6}},{{2,10},{4,5},{5,6},{6,2},{7,4},{8,5}}},
            {{{1,5},{2,7},{3,3},{4,9},{5,8},{7,9}},{{2,8},{3,5},{4,2},{5,6},{6,7},{7,10},{8,9}},{{2,10},{4,5},{5,6},{6,4},{7,1},{8,7}},{{1,10},{2,8},{3,9},{4,6},{5,4},{6,7}}},
            {{{1,10},{4,7},{5,6},{6,5},{7,2},{8,4}},{{2,10},{3,6},{4,4},{5,8},{6,9},{7,10}},{{1,1},{2,4},{3,5},{4,6},{6,10},{8,7}}},
            {{{1,3},{2,1},{3,6},{4,5},{5,9},{6,7},{7,8},{8,4}},{{1,12},{2,11},{3,7},{4,8},{5,10},{6,5},{7,6},{8,9}},{{1,4},{2,3},{3,2},{4,10},{5,3},{6,9},{7,5},{8,7}}},
            {{{1,3},{2,6},{3,7},{4,8},{5,9},{7,10}},{{1,10},{3,7},{4,4},{5,9},{6,8},{7,6}},{{2,9},{3,8},{4,7},{5,4},{6,2},{7,7}},{{1,11},{2,9},{4,6},{5,7},{6,5},{7,3},{8,6}}},
            {{{1,6},{2,7},{3,1},{4,4},{5,6},{6,9},{8,10}},{{1,11},{3,9},{4,9},{5,9},{6,7},{7,8},{8,4}},{{1,10},{2,5},{3,9},{4,10},{5,11},{7,10}}},
            {{{1,5},{2,4},{3,2},{4,6},{5,7},{7,10}},{{2,9},{4,9},{5,11},{6,9},{7,10},{8,5}},{{2,8},{3,9},{4,3},{5,8},{6,6},{8,10}}},
            {{{1,2},{2,8},{3,5},{4,9},{6,4},{8,10}},{{1,7},{2,4},{3,7},{4,8},{5,9},{7,10}},{{1,9},{2,9},{4,8},{5,5},{6,6},{7,7},{8,1}},{{1,9},{3,3},{4,7},{5,1},{6,5},{7,8}}}
    };

    public static final int INSTANCE8_MACHINE_NUM = 8;

    public static final int[][][][] INSTANCE10 = new int[][][][]{
            {{{1,1},{2,4},{3,6},{4,9},{5,3},{6,5},{7,2},{8,8},{9,9},{10,5}},{{1,4},{2,1},{3,1},{4,3},{5,4},{6,8},{7,10},{8,6},{9,11},{10,4}},{{1,3},{2,2},{3,5},{4,1},{5,5},{6,6},{7,9},{8,5},{9,10},{10,3}}},
            {{{1,2},{2,10},{3,4},{4,5},{5,9},{6,8},{7,4},{8,15},{9,8},{10,4},},{{1,4},{2,8},{3,7},{4,1},{5,9},{6,6},{7,1},{8,10},{9,7},{10,1}},{{1,6},{2,11},{3,2},{4,7},{5,5},{6,3},{7,5},{8,14},{9,9},{10,2}}},
            {{{1,8},{2,5},{3,8},{4,9},{5,4},{6,3},{7,5},{8,3},{9,8},{10,1}},{{1,9},{2,3},{3,6},{4,1},{5,2},{6,6},{7,4},{8,1},{9,7},{10,2}},{{1,7},{2,1},{3,8},{4,5},{5,4},{6,9},{7,1},{8,2},{9,3},{10,4}}},
            {{{1,5},{2,10},{3,6},{4,4},{5,9},{6,5},{7,1},{8,7},{9,1},{10,6}},{{1,4},{2,2},{3,3},{4,8},{5,7},{6,4},{7,6},{8,9},{9,8},{10,4}},{{1,7},{2,3},{3,12},{4,1},{5,6},{6,5},{7,8},{8,3},{9,5},{10,2}}},
            {{{1,7},{2,10},{3,4},{4,5},{5,6},{6,3},{7,5},{8,15},{9,2},{10,6}},{{1,5},{2,6},{3,3},{4,9},{5,8},{6,2},{7,8},{8,6},{9,1},{10,7}},{{1,6},{2,1},{3,4},{4,1},{5,10},{6,4},{7,3},{8,11},{9,13},{10,9}}},
            {{{1,8},{2,9},{3,10},{4,8},{5,4},{6,2},{7,7},{8,8},{9,3},{10,10}},{{1,7},{2,3},{3,12},{4,5},{5,4},{6,3},{7,6},{8,9},{9,2},{10,15}},{{1,4},{2,7},{3,3},{4,6},{5,3},{6,4},{7,1},{8,5},{9,1},{10,11}}},
            {{{1,1},{2,7},{3,8},{4,3},{5,4},{6,9},{7,4},{8,13},{9,10},{10,7}},{{1,3},{2,8},{3,1},{4,2},{5,3},{6,6},{7,11},{8,2},{9,13},{10,3}},{{1,5},{2,4},{3,2},{4,1},{5,2},{6,1},{7,8},{8,14},{9,5},{10,7}}},
            {{{1,5},{2,7},{3,11},{4,3},{5,2},{6,9},{7,8},{8,5},{9,12},{10,8}},{{1,8},{2,3},{3,10},{4,7},{5,5},{6,13},{7,4},{8,6},{9,8},{10,4}},{{1,2},{2,2},{3,13},{4,5},{5,4},{6,3},{7,5},{8,7},{9,9},{10,5}}},
            {{{1,3},{2,9},{3,1},{4,3},{5,8},{6,1},{7,6},{8,7},{9,5},{10,4}},{{1,4},{2,6},{3,2},{4,5},{5,7},{6,3},{7,1},{8,9},{9,6},{10,7}},{{1,8},{2,5},{3,4},{4,8},{5,6},{6,1},{7,2},{8,3},{9,10},{10,12}}},
            {{{1,4},{2,3},{3,1},{4,6},{5,7},{6,1},{7,2},{8,6},{9,20},{10,6}},{{1,3},{2,1},{3,8},{4,1},{5,9},{6,4},{7,1},{8,4},{9,17},{10,15}},{{1,9},{2,2},{3,4},{4,2},{5,3},{6,5},{7,2},{8,4},{9,10},{10,23}}}
    };

    public static final int  INSTANCE10_MACHINE_NUM = 10;

    public static final int[][][][] INSTANCE15 = new int[][][][]{
            {{{1,1},{2,4},{3,6},{4,9},{5,3},{6,5},{7,2},{8,8},{9,9},{10,4}},{{1,1},{2,1},{3,3},{4,4},{5,8},{6,10},{7,4},{8,11},{9,4},{10,3}},{{1,2},{2,5},{3,1},{4,5},{5,6},{6,9},{7,5},{8,10},{9,3},{10,2}},{{1,10},{2,4},{3,5},{4,9},{5,8},{6,4},{7,15},{8,8},{9,4},{10,4}}},
            {{{1,4},{2,8},{3,7},{4,1},{5,9},{6,6},{7,1},{8,10},{9,7},{10,1}},{{1,6},{2,11},{3,2},{4,7},{5,5},{6,3},{7,5},{8,14},{9,9},{10,2}},{{1,8},{2,5},{3,8},{4,9},{5,4},{6,3},{7,5},{8,3},{9,8},{10,1}},{{1,9},{2,3},{3,6},{4,1},{5,2},{6,6},{7,4},{8,1},{9,7},{10,2}}},
            {{{1,7},{2,1},{3,8},{4,5},{5,4},{6,9},{7,1},{8,2},{9,3},{10,4}},{{1,5},{2,10},{3,6},{4,4},{5,9},{6,5},{7,1},{8,7},{9,1},{10,6}},{{1,4},{2,2},{3,3},{4,8},{5,7},{6,4},{7,6},{8,9},{9,8},{10,4}},{{1,7},{2,3},{3,12},{4,1},{5,6},{6,5},{7,8},{8,3},{9,5},{10,2}},},
            {{{1,6},{2,2},{3,5},{4,4},{5,1},{6,2},{7,3},{8,6},{9,5},{10,4}},{{1,8},{2,5},{3,7},{4,4},{5,1},{6,2},{7,36},{8,5},{9,8},{10,5}},{{1,9},{2,6},{3,2},{4,4},{5,5},{6,1},{7,3},{8,6},{9,5},{10,2}},{{1,11},{2,4},{3,5},{4,6},{5,2},{6,7},{7,5},{8,4},{9,2},{10,1}},},
            {{{1,6},{2,9},{3,2},{4,3},{5,5},{6,8},{7,7},{8,4},{9,1},{10,2}},{{1,5},{2,4},{3,6},{4,3},{5,5},{6,2},{7,28},{8,7},{9,4},{10,5}},{{1,6},{2,2},{3,4},{4,3},{5,6},{6,5},{7,2},{8,4},{9,7},{10,9}},{{1,6},{2,5},{3,4},{4,2},{5,3},{6,2},{7,5},{8,4},{9,7},{10,5}}},
            {{{1,4},{2,1},{3,3},{4,2},{5,6},{6,9},{7,8},{8,5},{9,4},{10,2}},{{1,1},{2,3},{3,6},{4,5},{5,4},{6,7},{7,5},{8,4},{9,6},{10,5}}},
            {{{1,1},{2,4},{3,2},{4,5},{5,3},{6,6},{7,9},{8,8},{9,5},{10,4}},{{1,2},{2,1},{3,4},{4,5},{5,2},{6,3},{7,5},{8,4},{9,2},{10,5}}},
            {{{1,2},{2,3},{3,6},{4,2},{5,5},{6,4},{7,1},{8,5},{9,8},{10,7}},{{1,4},{2,5},{3,6},{4,2},{5,3},{6,5},{7,4},{8,1},{9,2},{10,5}},{{1,3},{2,5},{3,4},{4,2},{5,5},{6,49},{7,8},{8,5},{9,4},{10,5}},{{1,1},{2,2},{3,36},{4,5},{5,2},{6,3},{7,6},{8,4},{9,1},{10,2}}},
            {{{1,6},{2,3},{3,2},{4,22},{5,44},{6,11},{7,10},{8,23},{9,5},{10,1}},{{1,2},{2,3},{3,2},{4,12},{5,15},{6,10},{7,12},{8,14},{9,18},{10,16}},{{1,20},{2,17},{3,12},{4,5},{5,9},{6,6},{7,4},{8,7},{9,5},{10,6}},{{1,9},{2,8},{3,7},{4,4},{5,5},{6,8},{7,7},{8,4},{9,56},{10,2}}},
            {{{1,5},{2,8},{3,7},{4,4},{5,56},{6,3},{7,2},{8,5},{9,4},{10,1}},{{1,2},{2,5},{3,6},{4,9},{5,8},{6,5},{7,4},{8,2},{9,5},{10,4}},{{1,6},{2,3},{3,2},{4,5},{5,4},{6,7},{7,4},{8,5},{9,2},{10,1}},{{1,3},{2,2},{3,5},{4,6},{5,5},{6,8},{7,7},{8,4},{9,5},{10,2}}},
            {{{1,1},{2,2},{3,3},{4,6},{5,5},{6,2},{7,1},{8,4},{9,2},{10,1}},{{1,2},{2,3},{3,6},{4,3},{5,2},{6,1},{7,4},{8,10},{9,12},{10,1}},{{1,3},{2,6},{3,2},{4,5},{5,8},{6,4},{7,6},{8,3},{9,2},{10,5}},{{1,4},{2,1},{3,45},{4,6},{5,2},{6,4},{7,1},{8,25},{9,2},{10,4}}},
            {{{1,9},{2,8},{3,5},{4,6},{5,3},{6,6},{7,5},{8,2},{9,4},{10,2}},{{1,5},{2,8},{3,9},{4,5},{5,4},{6,75},{7,63},{8,6},{9,5},{10,21}},{{1,12},{2,5},{3,4},{4,6},{5,3},{6,2},{7,5},{8,4},{9,2},{10,5}},{{1,8},{2,7},{3,9},{4,5},{5,6},{6,3},{7,2},{8,5},{9,8},{10,4}}},
            {{{1,4},{2,2},{3,5},{4,6},{5,8},{6,5},{7,6},{8,4},{9,6},{10,2}},{{1,3},{2,5},{3,4},{4,7},{5,5},{6,8},{7,6},{8,6},{9,3},{10,2}},{{1,5},{2,4},{3,5},{4,8},{5,5},{6,4},{7,6},{8,5},{9,4},{10,2}},{{1,3},{2,2},{3,5},{4,6},{5,5},{6,4},{7,8},{8,5},{9,6},{10,4}}},
            {{{1,2},{2,3},{3,5},{4,4},{5,6},{6,5},{7,4},{8,85},{9,4},{10,5}},{{1,6},{2,2},{3,4},{4,5},{5,8},{6,6},{7,5},{8,4},{9,2},{10,6}},{{1,3},{2,25},{3,4},{4,8},{5,5},{6,6},{7,3},{8,2},{9,5},{10,4}},{{1,8},{2,5},{3,6},{4,4},{5,2},{6,3},{7,6},{8,8},{9,5},{10,4}}},
            {{{1,2},{2,5},{3,6},{4,8},{5,5},{6,6},{7,3},{8,2},{9,5},{10,4}},{{1,5},{2,6},{3,2},{4,5},{5,4},{6,2},{7,5},{8,3},{9,2},{10,5}},{{1,4},{2,5},{3,2},{4,3},{5,5},{6,2},{7,8},{8,4},{9,7},{10,5}},{{1,6},{2,2},{3,11},{4,14},{5,2},{6,3},{7,6},{8,5},{9,4},{10,8}}}
    };
    public static final int  INSTANCE15_MACHINE_NUM = 10;


    public static final int[][][][] XUGONG =  {
            {{{1,13800}},{{3,63360}},{{5,30400}},{{7,22280}},{{9,58080},{10,58080}},{{11,45920}},{{13,27040}},{{15,300}}},
            {{{1,15200},{2,17640}},{{3,70560},{4,58800}},{{5,51960},{6,35280}},{{7,34320},{8,35280}},{{9,64680},{10,64680}},{{11,50320},{12,56200}},{{13,29840},{14,29840}},{{15,300}}},
            {{{1,17360},{2,20160}},{{3,80640},{4,67200}},{{5,39200},{6,40320}},{{7,73600},{8,40320}},{{9,56480},{10,56480}},{{11,56480},{12,63200}},{{13,33760},{14,33760}},{{15,300}}},
            {{{2,16560}},{{4,27600}},{{6,16560}},{{8,16560}},{{9,30360},{10,30360}},{{12,26600}},{{14,14080}},{{15,300}}}
    };

    public static final int XUGONG_MACHINE_NUM = 15;
    /**
     * 构造函数，初始化相关数据
     */
    public RawData(){
        data = INSTANCE8;
        // 设置工件数量的值
        this.jobNum = data.length;
        // 设置总工序数量的值
        for(int i=0;i<data.length;i++){
            this.totalProcessNum+=data[i].length;
        }
        // 设置机器数量的值，该值应该为已知条件
        this.machineNum = INSTANCE8_MACHINE_NUM;
    }

    public int[][][][] getData() {
        return data;
    }

    public int getJobNum() {
        return jobNum;
    }

    public int getTotalProcessNum() {
        return totalProcessNum;
    }

    public int getMachineNum() {
        return machineNum;
    }

    public static RawData getInstance(Order... orders){
        return new RawData();
    }
}
